<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="UTF-8">
      <title>练习5</title>
    <script type="text/javascript">
      let f8 = (arr, fun) => {
        console.log("结果=",fun(arr));
      }

      //调用f8函数，arr是数组，fun传入箭头函数，可以计算arr的和
      f8([1,2,3],n=>{
        let res = 0;
        for (let i = 0; i < n.length; i++) {
          res += n[i];
        }
        return res;
      })
    </script>
  </head>
  <body>

  </body>
</html>